<?php
    function P($var){
        if(is_bool($var)){
            var_dump($var);
        }else if(is_null($var)){
            var_dump(NULL);
        }else{
            echo "<pre style='position:relative;z-index:1000;padding:10px;border-radius:5px;
            background:#F5F5F5;border:1px solid #aaa;font-size:14px;line-height:18px;opacity:0.9;'>"
            . print_r($var, true) . "</pre>";
        }
    }
    function C($control,$action){
        include 'app/controller/'.$control.'Controller.php';
        //$controller = $control.'Controller';
        $controller = '\app\controller\\'.$control.'Controller';
        $obj = new $controller();
        if (method_exists($obj,$action)){
            $obj->$action();
        }else {
            throw new Exception('未定义的方法:'.$action);
        }
    }
    function M($model){
        include 'app/model/'.$model.'Model.php';
        $model = '\app\model\\'.$model.'Controller';
        $obj = new $model();
        return ;
    }